package com.cmpe451.nutty.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "APP_USER")
public class User extends BaseModel {
	private static final long serialVersionUID = 1L;

	@Column(name = "USERNAME")
	private String username;

	@Column(name = "EMAIL", nullable = false, unique = true)
	private String email;

	@Column(name = "PASSWORD", nullable = false, length = 32)
	private String password;
	
	@Column(name = "NAME")
	private String name;
	
	@Column(name = "AGE")
	private Long age;

	@Column(name = "BIO")
	private String bio;

	@Column(name = "HOMETOWN")
	private String hometown;	
	
	@Column(name = "DIET_PREFERENCES")
	private String diet_preferences;

	@Column(name = "CURRENT_INGREDIENTS")
	private String current_ingredients;
	
	@Column(name = "HATED_INGREDIENTS")
	private String hated_ingredients;
	
	@Column(name = "LIKED_INGREDIENTS")
	private String liked_ingredients;
	
	@Column(name = "KITCHEN_TOOLS")
	private String kitchen_tools;	
	
	@Column(name = "LEVEL_POINT")
	private Long level_point;
	
	@Column(name = "IMAGE_LINK")
	private String image_link;
	
	@Column(name = "RATED_RECIPES")
	private String rated_recipes;
	
	@Column(name = "VALID")
	private int valid;

	@ManyToMany
	@JoinTable(name = "APP_USER_ROLE", joinColumns = { @JoinColumn(name = "APP_USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "APP_ROLE_NAME") })
	private Set<Role> roles = new HashSet<Role>();

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	public Long getLevel_point() {
		return level_point;
	}

	public void setLevel_point(Long level_point) {
		this.level_point = level_point;
	}

	public Long getAge() {
		return age;
	}

	public void setAge(Long age) {
		this.age = age;
	}

	public String getBio() {
		return bio;
	}

	public void setBio(String bio) {
		this.bio = bio;
	}

	public String getHometown() {
		return hometown;
	}

	public void setHometown(String hometown) {
		this.hometown = hometown;
	}

	public String getDiet_preferences() {
		return diet_preferences;
	}

	public void setDiet_preferences(String diet_preferences) {
		this.diet_preferences = diet_preferences;
	}

	public String getCurrent_ingredients() {
		return current_ingredients;
	}

	public void setCurrent_ingredients(String current_ingredients) {
		this.current_ingredients = current_ingredients;
	}

	public String getHated_ingredients() {
		return hated_ingredients;
	}

	public void setHated_ingredients(String hated_ingredients) {
		this.hated_ingredients = hated_ingredients;
	}

	public String getKitchen_tools() {
		return kitchen_tools;
	}

	public void setKitchen_tools(String kitchen_tools) {
		this.kitchen_tools = kitchen_tools;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getImage_link() {
		return image_link;
	}

	public void setImage_link(String image_link) {
		this.image_link = image_link;
	}

	public String getRated_recipes() {
		return rated_recipes;
	}

	public void setRated_recipes(String rated_recipes) {
		this.rated_recipes = rated_recipes;
	}

	public int getValid() {
		return valid;
	}

	public void setValid(int valid) {
		this.valid = valid;
	}

	public String getLiked_ingredients() {
		return liked_ingredients;
	}

	public void setLiked_ingredients(String liked_ingredients) {
		this.liked_ingredients = liked_ingredients;
	}
}
